<?
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$term_id=$_POST[term_id];
$term=$_POST[term];
$sql="insert into term(term_id,term) values('$term_id','$term')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=term.php'>";
}
if($_GET[MODE]=="DEL")
{
$term_id=$_GET[term_id];
$term=$_GET[term];
$sql="delete from term where term_id='$term_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=term.php'>";
}
if($_POST[MODE]=="EDIT")
{
$term_id=$_POST[term_id];
$term=$_POST[term];
$sql="UPDATE term set term_id='$term_id',term='$term' where term_id='$term_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=term.php'>";
}
?>
